<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include_once 'app/model/page/process.php';
include_once 'app/model/board/process.php';
include_once 'app/model/category/process.php';
include_once 'app/model/script/process.php';
include_once 'app/base/base-url.php';

$pages = new Pages();
$board = new Boards();
$category = new Categories();
$script = new Script();
$menu = $_GET["menu"];
$page_link = $pages->FillByPageLink($menu);
$board_url = $board->FillByBoardUrl($menu);
$page_tile = mysql_fetch_array($pages->FillByPageLink($menu));
$board_title = mysql_fetch_array($board->FillByBoardUrl($menu));
$category_title = mysql_fetch_array($category->FillByLink($menu));
$fillScript = mysql_fetch_array($script->FillAll());
?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title><?php if($menu == "") { ?>Thành lập công ty, Sở hữu trí tuệ, Xin giấy phép<?php } else if($menu != "" && $page_tile) { echo $page_tile["page_title"]; } else if($menu != "" && $board_title) { echo $board_title["board_name"]; } else if($menu == "dat-cau-hoi"){ echo "Đặt câu hỏi cho Bravolaw"; } else if($menu == "lien-he"){ echo "Liên hệ Bravolaw"; } else if($menu == "ve-chung-toi"){ echo "Giới thiệu Công ty TNHH tư vấn Bravo"; } else if($menu == "dia-chi"){ echo "Địa chỉ Công ty TNHH tư vấn Bravo"; } else { echo "Thành lập công ty, Sở hữu trí tuệ, Xin giấy phép"; } ?></title>
        <link rel="stylesheet" type="text/css" href="<?php echo $url["home"] ?>/css/style-main.css" />
        <?php if($menu != "") { ?>
        	<link rel="stylesheet" type="text/css" href="<?php echo $url["home"] ?>/css/style2.css" />
        <?php } ?>
        <link rel="stylesheet" type="text/css" href="<?php echo $url["home"] ?>/css/back-to-top.css" />
        <link rel="shortcut icon" href="<?php echo $url["home"] ?>/images/favicon/favicon.ico" />

        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/jquery/jquery-1.7.2.min.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/jquery/jquery.jcarousel.min.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/jquery/jquery.nivo.slider.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/jquery/jcarousellite_1.0.1c4.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/app/js/validate.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/inc/ckeditor/ckeditor.js"></script>
        <!--KEY SERVER AIzaSyAyUo2ktiLtqMdT4cIr-TP3E994iAQfxpc -->
        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=AIzaSyBDffN24VrnWRYlTkn0BZLn94azjDfPRJ4" type="text/javascript"></script>

        <script src="<?php echo $url["home"] ?>/js/swfobject_modified.js" type="text/javascript"></script>
        
		<?php if($menu == "") { ?>
        <!--SEO description, keywords, canonical-->
        <meta name="description" content="Dịch vụ tư vấn thành lập công ty, sở hữu trí tuệ, xin giấy phép, công bố lưu hành sản phẩm tuy tín, chuyên nghiệp nhất tại Bravolaw." />
        <meta name="keywords" content="tư vấn luật, thành lập công ty, sở hữu tri tuệ, xin giấy phép, dịch vụ kế toán" />
        <!--/SEO description, keywords, canonical--> 
        <?php } ?>
        <meta property="og:site_name" content="Bravolaw" />
        <?php if($rowPages = mysql_fetch_array($page_link)) { ?>
            <meta name="title" content="<?php echo $rowPages["seo_title"] ?>" />
            <meta name="description" content="<?php echo $rowPages["seo_description"] ?>" />
            <meta name="keywords" content="<?php echo $rowPages["seo_keyword"] ?>" />
            <meta property="og:url" content="<?php echo $_SERVER["HTTP_REFERER"] ?>" />
            <meta property="og:title" content="<?php echo $rowPages["page_title"] ?>" />
            <meta property="og:description" content="<?php echo $rowPages["page_summary"] ?>" /> 
            <?php 
                $tags = explode(",", $rowPages["page_tag"]);
                foreach($tags as $_tags) {
            ?>
            <meta property="article:tag" content="<?php echo $_tags ?>" />
            <?php } ?>
        <?php } 
		else { ?>
            <!--SEO description, keywords, canonical-->
            <meta name="description" content="Dịch vụ tư vấn thành lập công ty, sở hữu trí tuệ, xin giấy phép, công bố lưu hành sản phẩm tuy tín, chuyên nghiệp nhất tại Bravolaw." />
            <meta name="keywords" content="tư vấn luật, thành lập công ty, sở hữu tri tuệ, xin giấy phép, dịch vụ kế toán" />
            <!--/SEO description, keywords, canonical--> 
		<?php } ?>
        <?php if($rowBoards = mysql_fetch_array($board_url)) { ?>
            <meta property="og:url" content="<?php echo $_SERVER["HTTP_REFERER"] ?>" />
            <meta property="og:title" content="<?php echo $rowBoards["board_name"] ?>" />
        <?php } 
			else { ?>
            <!--SEO description, keywords, canonical-->
            <meta name="description" content="Dịch vụ tư vấn thành lập công ty, sở hữu trí tuệ, xin giấy phép, công bố lưu hành sản phẩm tuy tín, chuyên nghiệp nhất tại Bravolaw." />
            <meta name="keywords" content="tư vấn luật, thành lập công ty, sở hữu tri tuệ, xin giấy phép, dịch vụ kế toán" />
            <!--/SEO description, keywords, canonical--> 
		<?php } ?>
        <script type="text/javascript">
            //Phần gmaps vị trí công ty
            function initialize() {
                if (GBrowserIsCompatible()) {
                    var map = new GMap2(document.getElementById("map_canvas"));
                    map.setCenter(new GLatLng(37.4419, -122.1419), 15);
<?php if (isset($_POST['submit_form'])) { ?>
                map.setCenter(new GLatLng(<?php if (isset($_POST['kd'])) echo intval($_POST['kd']); ?>,<?php if (isset($_POST['vd'])) echo intval($_POST['vd']); ?>), <?php if (isset($_POST['zoom'])) echo intval($_POST['zoom']); ?>);
<?php } else { ?>
                map.setCenter(new GLatLng(21.020173399900084, 105.80956757068634), 15);//Tọa độ vị trí công ty
<?php } ?>
            map.openInfoWindow(map.getCenter(),
<?php if (isset($_POST['submit_form'])) { ?>
                document.createTextNode("<?php echo 'Kinh độ ' . intval($_POST['kd']) . ', Vĩ độ:' . intval($_POST['vd']); ?>"));
<?php } else { ?>
                document.createTextNode("Công ty TNHH tư vấn Bravo"));
<?php } ?>
            map.setUIToDefault();
        }
    }
	
        </script>


        <script language="javascript" type="text/javascript">	
            $(window).load(function() {
                $('div#slider').nivoSlider();
            });	
		</script>
        <!--Hieu ung Website-->
         <?php if($menu == "") { ?>		
            <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/news-post.js"></script>
        <?php } ?>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/jcarousel.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/dropdown.js"></script>

        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/slide-down-up.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo $url["home"] ?>/js/tabbed-nav.js"></script>
        <!--Hieu ung Website-->
        <script type='text/javascript'>
            $(function(){
                $(window).scroll(function(){
                    if($(this).scrollTop()!=0){
                        $('#bttop').fadeIn();
                    }else{
                        $('#bttop').fadeOut();
                    }
                });
                $('#bttop').click(function(){
                    $('body,html').animate({scrollTop:0},200);
                });
            });
        </script>
        <?php echo $fillScript["script_code"] ?>
    </head>
    <div id="bttop">BACK TO TOP</div>

    <body onload="initialize()" onunload="GUnload()">
        <div id="page">
            <div id="wrapper">
                <div id="header">
                    <?php include 'app/design/index_head.php'; ?>
                </div><!--End #header-->
                <!--clear position-->
                <div class="clear"></div>

                <div id="maincontent">  
                    <div id="top-content">
                        <?php if ($menu == "") : ?>
                            <?php include 'app/design/index_topcontent.php'; ?>
                        <?php endif; ?>
                    </div><!--End #top-content-->       
                    <div id="content">
                        <?php
                        //echo $menu;die;
                        switch ($menu) {
                            case 'search' : include 'app/view/search-pages.php';
                                break;
                            case 'tag' : include 'app/view/tag_pages.php';
                                break;
                            case 'dat-cau-hoi' : include 'app/view/questions.php';
								break;
                            case 'danh-sach-cau-hoi' : include 'app/view/danh-sach-cau-hoi.php';
                                break;
                            case 'tra-loi-cau-hoi' : include 'app/view/tra-loi-cau-hoi.php';
                                break;
                            case 'process-questions' : include 'app/controller/questions/process.php';
                                break;
                            case 'process-comment' : include 'app/controller/comment/process.php';
                                break;
                            case 'process-lienhe' : include 'app/controller/lienhe/process.php';
                                break;
                            case 'lien-he' : include 'app/view/lien-he.php';
                                break;
							case 'dia-chi' : include 'app/view/dia-chi.php';
                                break;
							case 've-chung-toi' : include 'app/view/ve-chung-toi.php';
                                break;
                            default :
                                if ($menu != "") {
                                    $link = $pages->FillByPageLink($menu);
                                    $board_name = $board->FillByBoardUrl($menu);
                                    $category_link = $category->FillByLink($menu);
                                    if (mysql_num_rows($link) > 0) {
                                        include 'app/view/page-detail.php';
                                    }
                                    if(mysql_num_rows($category_link)){
                                        include 'app/view/bai-viet-theo-chuyen-muc.php';
                                    }
                                    if (mysql_num_rows($board_name) > 0) {
                                        include 'app/view/bai-viet-theo-chuyen-muc.php';
                                    }
                                } else {
                                    include 'app/design/index_content.php';
                                }
                        }
                        ?>
                    </div><!--End #content-->

                    <div id="slidebar_right">
                        <?php include 'app/design/index_right.php'; ?>
                    </div><!--End #slidebar_right-->
                    <div class="clear"></div><!--End .clear-->
                </div><!--End #maincontent-->  
            </div><!--End #wrapper-->
            <div id="footer">
                <?php include 'app/design/index_footer.php'; ?>                                
            </div><!--End #footer-->
        </div><!--End #page-->
    </body>
</html>